#!/bin/sh 
#===================== 
#YuanHui.HE 
#khler@163.com 
#===================== 

echo "Current DIR is " $PWD 
stillRunning=$(ps -ef |grep "$PWD/CM300_CPP" |grep -v "grep") 
if [ "$stillRunning" ] ; then 
echo "TWS service was already started by another way" 
echo "Kill it and then startup by this shell, other wise this shell will loop out this message annoyingly" 
kill -9 $pidof $PWD/CM300_CPP 
else 
echo "TWS service was not started" 
echo "Starting service ..." 
$PWD/CM300_CPP 
echo "TWS service was exited!" 
fi 
